package ioc

import (
	"forum/internal/adapter/driven/web"
	"forum/internal/application"
	"github.com/gin-gonic/gin"
)

func InitWeb(userHandler *web.UserHandler, jwtHandler *application.JwtServiceImp, articleHandler *web.ArticleHandler) *gin.Engine {
	server := gin.Default()
	initMiddleware := InitMiddleware(jwtHandler)
	server.Use(initMiddleware...)
	userHandler.RegisterRouter(server)
	articleHandler.RegisterRouter(server)
	return server
}
